#define _CRT_SECURE_NO_WARNINGS
#define _CRT_SECURE_NO_WARNINGS
#include<stdio.h>
#include<string.h>
#include<assert.h>

void reserve(char* left, char* right)
{
	assert(left && right);
	while (left < right)
	{
		char tmp = *left;
		*left = *right;
		*right = tmp;
		left++;
		right--;

	}
}

int main()
{

	char arr[100] = { 0 };
	gets(arr);
	int len = strlen(arr);
	reserve(arr, arr + len - 1);

	char* blank = arr;
	while (*blank)
	{
		char* start = blank;
		while (*blank != ' ' && *blank != '\0')
		{
			blank++;
		}
		reserve(start, blank - 1);
		if (*blank != '\0')
		{
			blank++;
		}
	}

	printf("%s\n", arr);
	return 0;
}





